home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / (A)Z / (A)Z8.ADF / WBLander / dumpsprite.c < prev    next >
C/C++ Source or Header  |  1989-06-27  |  685b  |  28 lines

  1. #include <intuition/intuition.h>
  2. #define INTUITION_REV 1 
  3. struct IntuitionBase *IntuitionBase;
  4.  
  5. main()
  6. {
  7.     struct Preferences prefs;
  8.     int i;
  9.  
  10.     IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", INTUITION_REV);
  11.     if( IntuitionBase == NULL )
  12.     {
  13.         puts("can't open intuition\n");
  14.         exit(-1);
  15.     }
  16.  
  17.     GetPrefs(&prefs, sizeof prefs);
  18.     printf("USHORT sprite_colors[3] = { 0x%04x, 0x%04x, 0x%04x };\n",
  19.         prefs.color17, prefs.color18, prefs.color19);
  20.     printf("USHORT sprite[%d] = {\n", POINTERSIZE);
  21.     for(i = 0; i < POINTERSIZE; i += 2)
  22.         printf("\t0x%04x, 0x%04x%s\n",
  23.             prefs.PointerMatrix[i],
  24.             prefs.PointerMatrix[i+1],
  25.             (i+2<POINTERSIZE)?",":"");
  26.     printf("};\n");
  27. }
  28.